<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<!-- 该页面用于其它页面抽取公共部分 -->
<body>
<div th:fragment="header">
    <!-- header -->
    <div class="layui-fluid re-layui-fluid my-nav">
        <div class="my-nav-div">
            <div style="cursor: pointer;" onclick="javascript:window.location.href='/index'" class="my-nav-logo">北京自考社区</div>
            <ul class="layui-nav re-layui-nav my-nav-left">
                <li id="my-nav-item-1" class="layui-nav-item"><a href="/index">文章</a></li>
                <li id="my-nav-item-2" class="layui-nav-item"><a href="/question/question/toQuestionPage">问答</a></li>
            </ul>
            <ul style="margin-left: 360px;" class="re-layui-nav my-nav-left">
                <li class="layui-nav-item">
                    <form id="search-form" class="my-search-form">
                        <input id="input-search-form" type="text" placeholder="" value="" class="layui-input">
                        <i id="search-btn" class="layui-icon layui-icon-search"></i>
                    </form>
                </li>
            </ul>
            <ul class="layui-nav layui-layout-right re-layui-nav">
                <li shiro:notAuthenticated="" class="layui-nav-item"><a href="/loginPage">登录/注册</a></li>
                <li shiro:authenticated="" class="layui-nav-item">
                    <a href="javascript:;">
                        <img th:src="${session.user.profileUrl}" class="layui-nav-img">
                        <span th:if="${session.messageRemind}" style="margin-left: -12px;" class="layui-badge-dot"></span>
                        <span th:text="${session.user.name}"></span>
                    </a>
                    <!-- layui-anim layui-anim-upbit layui-show -->
                    <!-- 通过js监控用户行为，给相应块设置css实现动态效果 -->
                    <dl class="layui-nav-child re-layui-nav-child">
                        <dd><a href="/user/user/toUserCenter/1">个人中心
                                <span th:if="${session.messageRemind}" style="margin-left: 2px;" class="layui-badge-dot"></span>
                            </a>
                        </dd>
                        <dd><a href="/user/user/logout">退了</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item">
                    <a href="javascript:;">
                        <button class="layui-btn layui-btn-warm">创作中心</button>
                    </a>
                    <dl class="layui-nav-child re-layui-nav-child">
                        <dd><a href="javascript:;" id="writeArticle">写文章</a></dd>
                        <dd><a href="javascript:;" onclick="askQuestion()">提问题</a></dd>
                    </dl>
                </li>
                <li shiro:authenticated="" shiro:hasRole="admin" class="layui-nav-item"><a href="/managePage">后台管理</a></li>
            </ul>
        </div>
    </div>
</div>

<div th:fragment="footer">
    <!-- footer -->
    <div class="my-footer layui-fluid" style="padding-top: 18px;">
        <p>关于我们 广告服务 开发助手</p>
        <p>
            经营性网站备案信息
            北京互联网违法和不良信息举报中心
            网络110报警服务
            中国互联网举报中心
            家长监护
            Chrome商店下载
        </p>
        <p>版权与免责声明 版权申诉</p>
    </div>
</div>
</body>
</html>